package org.springblade.mes.sale.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 销售合同表的实体类
 * @author LHK
 * @since 2020-10-19
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sale_contract")
@ApiModel(value = "SaleContract对象", description = "销售合同表的实体")
public class SaleContract extends TenantEntity {
	
	private static final long serialVersionUID = 1L;
	
	@ApiModelProperty(value = "合同编号")
	private String contractNumber;

	@ApiModelProperty(value = "内部管理编号")
	private String manageNumber;
    
	@ApiModelProperty(value = "合同名称")
    private String contractName;
    
	@ApiModelProperty(value = "合同类型")
    private String contractType;
    
	@ApiModelProperty(value = "客户id")
    private Long customerId;
    
	@ApiModelProperty(value = "客户姓名")
    private String customerName;

	@ApiModelProperty(value = "客户编号")
	private String customerNumber;

	@ApiModelProperty(value = "采购员姓名")
	private String purchaserName;

	@ApiModelProperty(value = "订单编号(客户)")
	private String productNames;
    
	@ApiModelProperty(value = "签订日期")
	@JsonFormat(pattern = "yyyy-MM-dd")
    private Date signTime;

	@ApiModelProperty(value = "签订日期")
	@TableField(exist = false)
	private String signTimeStr;

	@ApiModelProperty(value = "合同开始日期")
	@JsonFormat(pattern = "yyyy-MM-dd")
	private Date contractStartTime;

	@ApiModelProperty(value = "合同开始日期")
	@TableField(exist = false)
	private String contractStartTimeStr;

	@ApiModelProperty(value = "合同结束日期")
	@JsonFormat(pattern = "yyyy-MM-dd")
	private Date contractEndTime;

	@ApiModelProperty(value = "合同结束日期")
	@TableField(exist = false)
	private String contractEndTimeStr;

	@ApiModelProperty(value = "规划接收人")
    private String signUser;
    
	@ApiModelProperty(value = "备注")
    private String remark;
	
	@ApiModelProperty(value = "创建人姓名")
	private String createUserName;

	@ApiModelProperty(value = "合同含税金额")
	private BigDecimal containTaxAmount;

	@ApiModelProperty(value = "税率")
	private String taxRate;

	@ApiModelProperty(value = "合同不含税金额")
	private BigDecimal notContainTaxAmount;

	@ApiModelProperty(value = "币种")
	private String currencyType;

	@ApiModelProperty(value = "关联采购订单号")
	private String unionPurchaseNo;

	@ApiModelProperty(value = "付款条件")
	private String paymentCondition;

	@ApiModelProperty(value = "是否委外")
	private String isOutsourcing;

	@ApiModelProperty(value = "委外合同号")
	private String outsourcingContractNumber;

	@ApiModelProperty(value = "采购接收人(客户)")
	private String purchaseReceiverName;

	@ApiModelProperty(value = "合同编号(客户)")
	private String customerContractNumber;

	@ApiModelProperty(value = "需求号")
	private String needNo;

	@ApiModelProperty(value = "付款方式")
	private String payMethod;

	@ApiModelProperty(value = "保函结束日期")
	@JsonFormat(pattern = "yyyy-MM-dd")
	private Date overDate;

	/**
	 * 保函结束日期开始
	 */
	@ApiModelProperty(value = "保函结束日期开始")
	@TableField(exist = false)
	private String overDateStart;
	/**
	 * 保函结束日期结束
	 */
	@ApiModelProperty(value = "保函结束日期结束")
	@TableField(exist = false)
	private String overDateEnd;

    //流程开始时间
    private Date applyTime;
    //流程定义id
    private String processDefinitionId;
    //流程实例id
    private String processInstanceId;

	@ApiModelProperty(value = "附件的ids")
	@TableField(exist = false)
	private String ids;
	/**
	 * 开始时间
	 */
	@ApiModelProperty(value = "开始时间")
	@TableField(exist = false)
	private String startTime;
	/**
	 * 结束时间
	 */
	@ApiModelProperty(value = "结束时间")
	@TableField(exist = false)
	private String endTime;

	/**
	 * 到期天数
	 */
	@ApiModelProperty(value = "到期天数")
	@TableField(exist = false)
	private String expireDays;

	@ApiModelProperty(value = "审批状态,1-未提交，2-审批中，3-已通过，4-未通过")
	@TableField(exist = false)
	private String statusStr;

	@ApiModelProperty(value = "创建日期")
	@TableField(exist = false)
	private String contractTimeAllStr;
	@ApiModelProperty(value = "创建日期")
	@TableField(exist = false)
	private String createTimeStr;

	@ApiModelProperty(value = "创建人姓名")
	@TableField(exist = false)
	private String createUserNames;

	@ApiModelProperty(value = "创建人姓名数组")
	@TableField(exist = false)
	private List<String> createUserNameList;

	@ApiModelProperty(value = "销售完成")
	@TableField(exist = false)
	private String saleOver;

	@ApiModelProperty(value = "回款完成")
	@TableField(exist = false)
	private String returnOver;

	@ApiModelProperty(value = "计划销售日期")
	@TableField(exist = false)
	private String planSaleDate;

	@ApiModelProperty(value = "计划回款日期")
	@TableField(exist = false)
	private String planReturnDate;

	@ApiModelProperty(value = "人员id")
	@TableField(exist = false)
	private Long personnalId;
	@ApiModelProperty(value = "销售订单个数")
	@TableField(exist = false)
	private Integer sellOrderCount;

	/**
	 * 项目编号
	 */
	@ApiModelProperty(value = "项目编号")
	private String projectNo;
}